package com.cy7;

import java.lang.reflect.Constructor;

/**
 * @author CY
 * @date 2022/10/22 23:58
 **/
public class SetAndMap {
    //第一个出现的字符
    public static int firstUniqChar(String s) {
        int[] arr = new int[128];
        for (int i = 0; i < s.length(); i++) {
            arr[s.charAt(i)]++;
        }
        for (int i = 0; i < s.length(); i++) {
            if (arr[s.charAt(i)] == 1) {
                return i;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
//        firstUniqChar("aabb");
        Class<?> classStudent = null;
        try {
            classStudent = Class.forName("com.cy7.MyBinarySearchTree");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        try {
            Constructor<?> declaredConstructorStudent = classStudent.getDeclaredConstructor(String.class, int.class);
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }


    }
}
